/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dio.com.gui;

import dio.com.model.Facade;
import dio.com.model.bean.*;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.List;

/**
 *
 * @author Diogenes
 */
public class Metas extends javax.swing.JDialog {

    private Atividade atividade;
    private Tipo tipo;
    private Periodo periodo;
    private Imposto imposto;
    private Meta meta;

    /**
     * Creates new form Metas
     */
    public Metas(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        atividade = new Atividade();
        tipo = new Tipo();
        periodo = new Periodo();
        imposto = new Imposto();
        meta = new Meta();
        setLocationRelativeTo(null);
        carregarData();
        carregarMetas();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();
        tfEscrituracao = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        tfIntegracaoContabil = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        tfDarfIrrf = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        tfDaeParcelado = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        tfISS = new javax.swing.JTextField();
        tfIPI = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        tjPIS = new javax.swing.JTextField();
        tjCofins = new javax.swing.JTextField();
        tjICMSNormal = new javax.swing.JTextField();
        tjICMSAntecipado = new javax.swing.JTextField();
        tjIRPJ = new javax.swing.JTextField();
        tjCSLL = new javax.swing.JTextField();
        jLabel29 = new javax.swing.JLabel();
        tjSimplesNacional = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jLabel19 = new javax.swing.JLabel();
        tfContabilizadoAte = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        tfDataDaUltimaMovimentacao = new javax.swing.JTextField();
        jPanel3 = new javax.swing.JPanel();
        tfGPS = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        tfFolhaPagamento = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        tfIntegracaoContabilTrabalhista = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        tfFGTS = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        tfIRRF = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        tfContribuicaoSindical = new javax.swing.JTextField();
        jLabel30 = new javax.swing.JLabel();
        tfRAIS = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        jLabel31 = new javax.swing.JLabel();
        tfRFB = new javax.swing.JTextField();
        jLabel32 = new javax.swing.JLabel();
        tfSEFAZ = new javax.swing.JTextField();
        jLabel33 = new javax.swing.JLabel();
        tfPrefeitura = new javax.swing.JTextField();
        jLabel34 = new javax.swing.JLabel();
        tfINSS = new javax.swing.JTextField();
        jLabel35 = new javax.swing.JLabel();
        tfCND_FGTS = new javax.swing.JTextField();
        jPanel6 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        tfGIA_GIN = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        tfDIRF = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        tfDCTF = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        tfDACON = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        tfSEF = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        tfDS = new javax.swing.JTextField();
        jLabel36 = new javax.swing.JLabel();
        tfSPED_PIS = new javax.swing.JTextField();
        jLabel37 = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        tfSPED_FISCAL = new javax.swing.JTextField();
        tfDIPJ = new javax.swing.JTextField();
        jLabel39 = new javax.swing.JLabel();
        tfDASN = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        rbLucroReal = new javax.swing.JRadioButton();
        rbLucroPresumido = new javax.swing.JRadioButton();
        rbSimplesNacional = new javax.swing.JRadioButton();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel14 = new javax.swing.JLabel();
        rbComercial = new javax.swing.JRadioButton();
        rbIndustrial = new javax.swing.JRadioButton();
        rbServicos = new javax.swing.JRadioButton();
        btSalvar = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JSeparator();
        jLabel40 = new javax.swing.JLabel();
        jLabel41 = new javax.swing.JLabel();
        jLabel42 = new javax.swing.JLabel();
        cbMes = new javax.swing.JComboBox();
        cbAno = new javax.swing.JComboBox();
        btCancelar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Cadastro de metas");

        jLabel15.setText("Escrituração");

        tfEscrituracao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfEscrituracaoActionPerformed(evt);
            }
        });

        jLabel16.setText("Integração contábil");

        tfIntegracaoContabil.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfIntegracaoContabilActionPerformed(evt);
            }
        });

        jLabel17.setText("DARF/IRRF");

        tfDarfIrrf.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfDarfIrrfActionPerformed(evt);
            }
        });

        jLabel18.setText("DAE - PARCELADO");

        tfDaeParcelado.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfDaeParceladoActionPerformed(evt);
            }
        });

        jLabel21.setText("ISS");

        jLabel22.setText("IPI");

        tfISS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfISSActionPerformed(evt);
            }
        });

        tfIPI.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfIPIActionPerformed(evt);
            }
        });

        jLabel23.setText("PIS");

        jLabel24.setText("COFINS");

        jLabel25.setText("ICMS Normal");

        jLabel26.setText("ICMS Antecipado");

        jLabel27.setText("CSLL");

        jLabel28.setText("IRPJ");

        tjPIS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tjPISActionPerformed(evt);
            }
        });

        tjCofins.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tjCofinsActionPerformed(evt);
            }
        });

        tjICMSNormal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tjICMSNormalActionPerformed(evt);
            }
        });

        tjICMSAntecipado.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tjICMSAntecipadoActionPerformed(evt);
            }
        });

        tjIRPJ.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tjIRPJActionPerformed(evt);
            }
        });

        tjCSLL.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tjCSLLActionPerformed(evt);
            }
        });

        jLabel29.setText("Simples Nacional");

        tjSimplesNacional.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tjSimplesNacionalActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(tfEscrituracao, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel16)
                            .addComponent(jLabel15)
                            .addComponent(jLabel17)
                            .addComponent(tfIntegracaoContabil, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(tfDarfIrrf, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel18)
                            .addComponent(jLabel21)
                            .addComponent(jLabel22)
                            .addComponent(tfDaeParcelado, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(tfISS, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(tfIPI, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(tjIRPJ, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(tjPIS, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(tjCofins, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(tjICMSNormal, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(tjICMSAntecipado, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel28)
                            .addComponent(tjCSLL, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel27)
                            .addComponent(jLabel26)
                            .addComponent(jLabel25)
                            .addComponent(jLabel24)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(111, 111, 111)
                        .addComponent(jLabel23)))
                .addGap(10, 10, 10)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel29)
                    .addComponent(tjSimplesNacional, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(582, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(jLabel23)
                    .addComponent(jLabel29))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tfEscrituracao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tjPIS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tjSimplesNacional, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(jLabel24))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tfIntegracaoContabil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tjCofins, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(jLabel25))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tfDarfIrrf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tjICMSNormal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(jLabel26))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tfDaeParcelado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tjICMSAntecipado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21)
                    .addComponent(jLabel27))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tfISS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tjCSLL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel22)
                    .addComponent(jLabel28))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tfIPI, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tjIRPJ, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(65, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Fiscal", jPanel1);

        jLabel19.setText("Contabilizado até:");

        tfContabilizadoAte.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfContabilizadoAteActionPerformed(evt);
            }
        });

        jLabel20.setText("Data da última movimentação:");

        tfDataDaUltimaMovimentacao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfDataDaUltimaMovimentacaoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel19)
                    .addComponent(jLabel20)
                    .addComponent(tfDataDaUltimaMovimentacao, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tfContabilizadoAte, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(730, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel19)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(tfContabilizadoAte, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel20)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(tfDataDaUltimaMovimentacao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(279, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Contabilidade", jPanel2);

        tfGPS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfGPSActionPerformed(evt);
            }
        });

        jLabel7.setText("GPS:");

        tfFolhaPagamento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfFolhaPagamentoActionPerformed(evt);
            }
        });

        jLabel8.setText("Folha de Pagamento:");

        tfIntegracaoContabilTrabalhista.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfIntegracaoContabilTrabalhistaActionPerformed(evt);
            }
        });

        jLabel9.setText("Integração Contábil:");

        tfFGTS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfFGTSActionPerformed(evt);
            }
        });

        jLabel10.setText("FGTS:");

        tfIRRF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfIRRFActionPerformed(evt);
            }
        });

        jLabel11.setText("IRRF");

        jLabel12.setText("Contribuição Sindical");

        tfContribuicaoSindical.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfContribuicaoSindicalActionPerformed(evt);
            }
        });

        jLabel30.setText("RAIS");

        tfRAIS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfRAISActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(tfRAIS, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel30)
                    .addComponent(tfGPS, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7)
                    .addComponent(tfFolhaPagamento, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8)
                    .addComponent(tfIntegracaoContabilTrabalhista, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9)
                    .addComponent(jLabel12)
                    .addComponent(tfFGTS, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10)
                    .addComponent(tfIRRF, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11)
                    .addComponent(tfContribuicaoSindical, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(752, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel12)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tfContribuicaoSindical, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(11, 11, 11)
                .addComponent(jLabel11)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tfIRRF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel10)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tfFGTS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel9)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tfIntegracaoContabilTrabalhista, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tfFolhaPagamento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel7)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tfGPS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel30)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tfRAIS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(59, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Trabalhista", jPanel3);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 885, Short.MAX_VALUE)
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 391, Short.MAX_VALUE)
        );

        jTabbedPane1.addTab("Impostos", jPanel4);

        jLabel31.setText("RFB");

        tfRFB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfRFBActionPerformed(evt);
            }
        });

        jLabel32.setText("SEFAZ");

        tfSEFAZ.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfSEFAZActionPerformed(evt);
            }
        });

        jLabel33.setText("Prefeitura Municipal");

        tfPrefeitura.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfPrefeituraActionPerformed(evt);
            }
        });

        jLabel34.setText("INSS");

        tfINSS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfINSSActionPerformed(evt);
            }
        });

        jLabel35.setText("FGTS");

        tfCND_FGTS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfCND_FGTSActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel31)
                    .addComponent(tfRFB, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel32)
                    .addComponent(tfSEFAZ, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel33)
                    .addComponent(tfPrefeitura, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel34)
                    .addComponent(tfINSS, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel35)
                    .addComponent(tfCND_FGTS, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(781, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel31)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tfRFB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel32)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tfSEFAZ, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel33)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tfPrefeitura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel34)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tfINSS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(9, 9, 9)
                .addComponent(jLabel35)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(tfCND_FGTS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(133, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("CND", jPanel5);

        jLabel1.setText("GIA/GIN:");

        tfGIA_GIN.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
        tfGIA_GIN.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfGIA_GINActionPerformed(evt);
            }
        });

        jLabel2.setText("DIRF:");

        tfDIRF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfDIRFActionPerformed(evt);
            }
        });

        jLabel3.setText("DCTF:");

        tfDCTF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfDCTFActionPerformed(evt);
            }
        });

        jLabel4.setText("DACON");

        tfDACON.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfDACONActionPerformed(evt);
            }
        });

        jLabel5.setText("SEF");

        tfSEF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfSEFActionPerformed(evt);
            }
        });

        jLabel6.setText("DS:");

        tfDS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfDSActionPerformed(evt);
            }
        });

        jLabel36.setText("SPED PIS/CONFINS");

        tfSPED_PIS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfSPED_PISActionPerformed(evt);
            }
        });

        jLabel37.setText("SPED FISCAL");

        jLabel38.setText("DIPJ");

        tfSPED_FISCAL.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfSPED_FISCALActionPerformed(evt);
            }
        });

        tfDIPJ.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfDIPJActionPerformed(evt);
            }
        });

        jLabel39.setText("DASN");

        tfDASN.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfDASNActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(tfDS, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(tfSEF, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jLabel1)
                                    .addComponent(jLabel2)
                                    .addComponent(jLabel3)
                                    .addComponent(tfGIA_GIN)
                                    .addComponent(tfDCTF)
                                    .addComponent(tfDIRF)
                                    .addComponent(jLabel4)
                                    .addComponent(tfDACON, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addComponent(jLabel5)))
                        .addComponent(jLabel6)))
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGap(15, 15, 15)
                        .addComponent(jLabel36))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel39)
                            .addComponent(jLabel38)
                            .addComponent(jLabel37)
                            .addComponent(tfSPED_PIS)
                            .addComponent(tfSPED_FISCAL)
                            .addComponent(tfDIPJ)
                            .addComponent(tfDASN))))
                .addContainerGap(669, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jLabel36))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tfGIA_GIN, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tfSPED_PIS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel37))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tfDIRF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tfSPED_FISCAL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jLabel38))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tfDCTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tfDIPJ, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jLabel39))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tfDACON, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tfDASN, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(tfSEF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(tfDS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(65, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Declarações", jPanel6);

        jLabel13.setText("Tipo da Empresa:");

        rbLucroReal.setText("Lucro Real");
        rbLucroReal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbLucroRealActionPerformed(evt);
            }
        });

        rbLucroPresumido.setText("Lucro Presumido");
        rbLucroPresumido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbLucroPresumidoActionPerformed(evt);
            }
        });

        rbSimplesNacional.setText("Simples Nacional");
        rbSimplesNacional.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbSimplesNacionalActionPerformed(evt);
            }
        });

        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);

        jLabel14.setText("Atividade:");

        rbComercial.setText("Comercial");
        rbComercial.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbComercialActionPerformed(evt);
            }
        });

        rbIndustrial.setText("Industrial");
        rbIndustrial.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbIndustrialActionPerformed(evt);
            }
        });

        rbServicos.setText("Serviços");
        rbServicos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbServicosActionPerformed(evt);
            }
        });

        btSalvar.setText("Salvar");
        btSalvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSalvarActionPerformed(evt);
            }
        });

        jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);

        jLabel40.setText("Periodo:");

        jLabel41.setText("Mês:");

        jLabel42.setText("Ano");

        cbMes.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "JANEIRO", "FEVEREIRO", "MARÇO", "ABRIL", "MAIO", "JUNHO", "JULHO", "AGOSTO", "SETEMBRO", "OUTUBRO", "NOVEMBRO", "DEZEMBRO" }));
        cbMes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cbMesActionPerformed(evt);
            }
        });

        cbAno.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "121","2012", "2013", "2014", "2015" }));

        btCancelar.setText("Cancelar");
        btCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btCancelarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jTabbedPane1)
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel13)
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(rbLucroPresumido)
                            .addComponent(rbSimplesNacional)
                            .addComponent(rbLucroReal))
                        .addGap(9, 9, 9)
                        .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel14)
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(rbComercial)
                            .addComponent(rbIndustrial)
                            .addComponent(rbServicos))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel40)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabel41)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(cbMes, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(20, 20, 20)
                                        .addComponent(jLabel42)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(cbAno, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addGap(0, 0, Short.MAX_VALUE)
                                .addComponent(btSalvar)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(btCancelar)
                                .addContainerGap())))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator1)
                    .addComponent(jSeparator2, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel13)
                                    .addComponent(rbLucroReal))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(rbLucroPresumido)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(rbSimplesNacional))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel14)
                                    .addComponent(rbComercial))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(rbIndustrial)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(rbServicos))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel40)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(cbAno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel41)
                                        .addComponent(cbMes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel42)))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(btSalvar)
                            .addComponent(btCancelar))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 416, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSalvarActionPerformed
        Facade.getInstancia().commit();
    }//GEN-LAST:event_btSalvarActionPerformed
    private void rbIndustrialActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbIndustrialActionPerformed
        if (!rbComercial.isSelected() && !rbIndustrial.isSelected() && !rbServicos.isSelected()) {
            rbIndustrial.setSelected(true);
        }
        atividade.setId(2);
        limparCampos();
        carregarMetas();
        rbComercial.setSelected(false);
        rbServicos.setSelected(false);
    }//GEN-LAST:event_rbIndustrialActionPerformed

    private void tfEscrituracaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfEscrituracaoActionPerformed
        definirAtributos();
        imposto.setId(1);
        meta.setImposto(imposto);
        meta.setValorMeta(tfEscrituracao.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfEscrituracaoActionPerformed

    private void tfIntegracaoContabilActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfIntegracaoContabilActionPerformed
        definirAtributos();
        imposto.setId(2);
        meta.setImposto(imposto);
        meta.setValorMeta(tfIntegracaoContabil.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfIntegracaoContabilActionPerformed

    private void btCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btCancelarActionPerformed
        Facade.getInstancia().rollback();
    }//GEN-LAST:event_btCancelarActionPerformed

    private void tfDarfIrrfActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfDarfIrrfActionPerformed
        definirAtributos();
        imposto.setId(3);
        meta.setImposto(imposto);
        meta.setValorMeta(tfDarfIrrf.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfDarfIrrfActionPerformed

    private void tfDaeParceladoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfDaeParceladoActionPerformed
        definirAtributos();
        imposto.setId(4);
        meta.setImposto(imposto);
        meta.setValorMeta(tfDaeParcelado.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfDaeParceladoActionPerformed

    private void tfISSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfISSActionPerformed
        definirAtributos();
        imposto.setId(5);
        meta.setImposto(imposto);
        meta.setValorMeta(tfISS.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfISSActionPerformed

    private void tfIPIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfIPIActionPerformed
        definirAtributos();
        imposto.setId(6);
        meta.setImposto(imposto);
        meta.setValorMeta(tfIPI.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfIPIActionPerformed

    private void tjPISActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tjPISActionPerformed
        definirAtributos();
        imposto.setId(7);
        meta.setImposto(imposto);
        meta.setValorMeta(tjPIS.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tjPISActionPerformed

    private void tjCofinsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tjCofinsActionPerformed
        definirAtributos();
        imposto.setId(8);
        meta.setImposto(imposto);
        meta.setValorMeta(tjCofins.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tjCofinsActionPerformed

    private void tjICMSNormalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tjICMSNormalActionPerformed
        definirAtributos();
        imposto.setId(9);
        meta.setImposto(imposto);
        meta.setValorMeta(tjICMSNormal.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tjICMSNormalActionPerformed

    private void tjICMSAntecipadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tjICMSAntecipadoActionPerformed
        definirAtributos();
        imposto.setId(10);
        meta.setImposto(imposto);
        meta.setValorMeta(tjICMSAntecipado.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tjICMSAntecipadoActionPerformed

    private void tjCSLLActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tjCSLLActionPerformed
        definirAtributos();
        imposto.setId(11);
        meta.setImposto(imposto);
        meta.setValorMeta(tjCSLL.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tjCSLLActionPerformed

    private void tjIRPJActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tjIRPJActionPerformed
        definirAtributos();
        imposto.setId(12);
        meta.setImposto(imposto);
        meta.setValorMeta(tjIRPJ.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tjIRPJActionPerformed

    private void tjSimplesNacionalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tjSimplesNacionalActionPerformed
        definirAtributos();
        imposto.setId(13);
        meta.setImposto(imposto);
        meta.setValorMeta(tjSimplesNacional.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tjSimplesNacionalActionPerformed

    private void tfContabilizadoAteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfContabilizadoAteActionPerformed
        definirAtributos();
        imposto.setId(14);
        meta.setImposto(imposto);
        meta.setValorMeta(tfContabilizadoAte.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfContabilizadoAteActionPerformed

    private void tfDataDaUltimaMovimentacaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfDataDaUltimaMovimentacaoActionPerformed
        definirAtributos();
        imposto.setId(15);
        meta.setImposto(imposto);
        meta.setValorMeta(tfDataDaUltimaMovimentacao.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfDataDaUltimaMovimentacaoActionPerformed

    private void cbMesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbMesActionPerformed
        limparCampos();
        carregarMetas();
    }//GEN-LAST:event_cbMesActionPerformed

    private void tfContribuicaoSindicalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfContribuicaoSindicalActionPerformed
        definirAtributos();
        imposto.setId(16);
        meta.setImposto(imposto);
        meta.setValorMeta(tfContribuicaoSindical.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfContribuicaoSindicalActionPerformed

    private void tfIRRFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfIRRFActionPerformed
        definirAtributos();
        imposto.setId(17);
        meta.setImposto(imposto);
        meta.setValorMeta(tfIRRF.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfIRRFActionPerformed

    private void tfFGTSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfFGTSActionPerformed
        definirAtributos();
        imposto.setId(18);
        meta.setImposto(imposto);
        meta.setValorMeta(tfFGTS.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfFGTSActionPerformed

    private void tfIntegracaoContabilTrabalhistaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfIntegracaoContabilTrabalhistaActionPerformed
        definirAtributos();
        imposto.setId(19);
        meta.setImposto(imposto);
        meta.setValorMeta(tfIntegracaoContabil.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfIntegracaoContabilTrabalhistaActionPerformed

    private void tfFolhaPagamentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfFolhaPagamentoActionPerformed
        definirAtributos();
        imposto.setId(20);
        meta.setImposto(imposto);
        meta.setValorMeta(tfFolhaPagamento.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfFolhaPagamentoActionPerformed

    private void tfGPSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfGPSActionPerformed
        definirAtributos();
        imposto.setId(21);
        meta.setImposto(imposto);
        meta.setValorMeta(tfGPS.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfGPSActionPerformed

    private void tfRAISActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfRAISActionPerformed
        definirAtributos();
        imposto.setId(22);
        meta.setImposto(imposto);
        meta.setValorMeta(tfRAIS.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfRAISActionPerformed

    private void tfRFBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfRFBActionPerformed
        definirAtributos();
        imposto.setId(23);
        meta.setImposto(imposto);
        meta.setValorMeta(tfRFB.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfRFBActionPerformed

    private void tfSEFAZActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfSEFAZActionPerformed
        definirAtributos();
        imposto.setId(24);
        meta.setImposto(imposto);
        meta.setValorMeta(tfSEFAZ.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfSEFAZActionPerformed

    private void tfPrefeituraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfPrefeituraActionPerformed
        definirAtributos();
        imposto.setId(25);
        meta.setImposto(imposto);
        meta.setValorMeta(tfPrefeitura.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfPrefeituraActionPerformed

    private void tfINSSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfINSSActionPerformed
        definirAtributos();
        imposto.setId(26);
        meta.setImposto(imposto);
        meta.setValorMeta(tfINSS.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfINSSActionPerformed

    private void tfCND_FGTSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfCND_FGTSActionPerformed
        definirAtributos();
        imposto.setId(27);
        meta.setImposto(imposto);
        meta.setValorMeta(tfCND_FGTS.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfCND_FGTSActionPerformed

    private void tfGIA_GINActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfGIA_GINActionPerformed
        definirAtributos();
        imposto.setId(28);
        meta.setImposto(imposto);
        meta.setValorMeta(tfGIA_GIN.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfGIA_GINActionPerformed

    private void tfDIRFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfDIRFActionPerformed
        definirAtributos();
        imposto.setId(29);
        meta.setImposto(imposto);
        meta.setValorMeta(tfDIRF.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfDIRFActionPerformed

    private void tfDCTFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfDCTFActionPerformed
        definirAtributos();
        imposto.setId(37);
        meta.setImposto(imposto);
        meta.setValorMeta(tfDCTF.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfDCTFActionPerformed

    private void tfDACONActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfDACONActionPerformed
        definirAtributos();
        imposto.setId(30);
        meta.setImposto(imposto);
        meta.setValorMeta(tfDACON.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfDACONActionPerformed

    private void tfSEFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfSEFActionPerformed
        definirAtributos();
        imposto.setId(31);
        meta.setImposto(imposto);
        meta.setValorMeta(tfSEF.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfSEFActionPerformed

    private void tfDSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfDSActionPerformed
        definirAtributos();
        imposto.setId(32);
        meta.setImposto(imposto);
        meta.setValorMeta(tfDS.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfDSActionPerformed

    private void tfSPED_PISActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfSPED_PISActionPerformed
        definirAtributos();
        imposto.setId(33);
        meta.setImposto(imposto);
        meta.setValorMeta(tfSPED_PIS.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfSPED_PISActionPerformed

    private void tfSPED_FISCALActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfSPED_FISCALActionPerformed
        definirAtributos();
        imposto.setId(34);
        meta.setImposto(imposto);
        meta.setValorMeta(tfSPED_FISCAL.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfSPED_FISCALActionPerformed

    private void tfDIPJActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfDIPJActionPerformed
        definirAtributos();
        imposto.setId(35);
        meta.setImposto(imposto);
        meta.setValorMeta(tfDIPJ.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfDIPJActionPerformed

    private void tfDASNActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfDASNActionPerformed
        definirAtributos();
        imposto.setId(36);
        meta.setImposto(imposto);
        meta.setValorMeta(tfDASN.getText());
        if (Facade.getInstancia().existeMeta(meta)) {
            Facade.getInstancia().editarMeta(meta);
        } else {
            Facade.getInstancia().salvarMeta(meta);
        }
    }//GEN-LAST:event_tfDASNActionPerformed

    private void rbLucroRealActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbLucroRealActionPerformed
        if (!rbLucroPresumido.isSelected() && !rbLucroReal.isSelected() && !rbSimplesNacional.isSelected()) {
            rbLucroReal.setSelected(true);
        }
        tipo.setId(1);
        limparCampos();
        carregarMetas();
        rbLucroPresumido.setSelected(false);
        rbSimplesNacional.setSelected(false);
    }//GEN-LAST:event_rbLucroRealActionPerformed

    private void rbLucroPresumidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbLucroPresumidoActionPerformed
        if (!rbLucroPresumido.isSelected() && !rbLucroReal.isSelected() && !rbSimplesNacional.isSelected()) {
            rbLucroPresumido.setSelected(true);
        }
        tipo.setId(2);
        limparCampos();
        carregarMetas();
        rbSimplesNacional.setSelected(false);
        rbLucroReal.setSelected(false);
    }//GEN-LAST:event_rbLucroPresumidoActionPerformed

    private void rbSimplesNacionalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbSimplesNacionalActionPerformed
        if (!rbLucroPresumido.isSelected() && !rbLucroReal.isSelected() && !rbSimplesNacional.isSelected()) {
            rbSimplesNacional.setSelected(true);
        }
        tipo.setId(3);
        limparCampos();
        carregarMetas();
        rbLucroPresumido.setSelected(false);
        rbLucroReal.setSelected(false);
    }//GEN-LAST:event_rbSimplesNacionalActionPerformed

    private void rbComercialActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbComercialActionPerformed
        if (!rbComercial.isSelected() && !rbIndustrial.isSelected() && !rbServicos.isSelected()) {
            rbComercial.setSelected(true);
        }
        atividade.setId(1);
        limparCampos();
        carregarMetas();
        rbIndustrial.setSelected(false);
        rbServicos.setSelected(false);
    }//GEN-LAST:event_rbComercialActionPerformed

    private void rbServicosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbServicosActionPerformed
        if (!rbComercial.isSelected() && !rbIndustrial.isSelected() && !rbServicos.isSelected()) {
            rbServicos.setSelected(true);
        }
        atividade.setId(3);
        limparCampos();
        carregarMetas();
        rbIndustrial.setSelected(false);
        rbComercial.setSelected(false);
    }//GEN-LAST:event_rbServicosActionPerformed

    private void definirAtributos() {
        //ATIVIDADE
        if (rbComercial.isSelected()) {
            atividade.setId(1);
            meta.setAtividade(atividade);
        } else if (rbIndustrial.isSelected()) {
            atividade.setId(2);
            meta.setAtividade(atividade);
        } else if (rbServicos.isSelected()) {
            atividade.setId(3);
            meta.setAtividade(atividade);
        }
        //TIPO DA EMPRESA
        if (rbLucroReal.isSelected()) {
            tipo.setId(1);
            meta.setTipo(tipo);
        } else if (rbLucroPresumido.isSelected()) {
            tipo.setId(2);
            meta.setTipo(tipo);
        } else if (rbSimplesNacional.isSelected()) {
            tipo.setId(3);
            meta.setTipo(tipo);
        }
        //PERÍODO
        periodo.setId(cbMes.getSelectedIndex() + 1);
        meta.setPeriodo(periodo);
    }

    private void carregarMetas() {
        periodo.setId(cbMes.getSelectedIndex() + 1);
        meta.setPeriodo(periodo);
        meta.setAtividade(atividade);
        meta.setTipo(tipo);
        List<Meta> metas = Facade.getInstancia().carregaMeta(meta);
        for (Meta metas1 : metas) {
            if (metas1.getImposto().getId() == 1) {
                tfEscrituracao.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 2) {
                tfIntegracaoContabil.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 3) {
                tfDarfIrrf.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 4) {
                tfDaeParcelado.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 5) {
                tfISS.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 6) {
                tfIPI.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 7) {
                tjPIS.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 8) {
                tjCofins.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 9) {
                tjICMSNormal.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 10) {
                tjICMSAntecipado.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 11) {
                tjCSLL.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 12) {
                tjIRPJ.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 13) {
                tjSimplesNacional.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 14) {
                tfContabilizadoAte.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 15) {
                tfDataDaUltimaMovimentacao.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 16) {
                tfContribuicaoSindical.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 17) {
                tfIRRF.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 18) {
                tfFGTS.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 19) {
                tfIntegracaoContabil.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 20) {
                tfFolhaPagamento.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 21) {
                tfGPS.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 22) {
                tfRAIS.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 23) {
                tfRFB.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 24) {
                tfSEFAZ.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 25) {
                tfPrefeitura.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 26) {
                tfINSS.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 27) {
                tfCND_FGTS.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 28) {
                tfGIA_GIN.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 29) {
                tfDIRF.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 30) {
                tfDACON.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 31) {
                tfSEF.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 32) {
                tfDS.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 33) {
                tfSPED_PIS.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 34) {
                tfSPED_FISCAL.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 35) {
                tfDIPJ.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 36) {
                tfDASN.setText(metas1.getValorMeta());
            } else if (metas1.getImposto().getId() == 37) {
                tfDCTF.setText(metas1.getValorMeta());
            }
        }

    }

    private void carregarData() {
        GregorianCalendar agora = new GregorianCalendar();
        int mes = agora.get(Calendar.MONTH);
        int ano = agora.get(Calendar.YEAR);
        cbMes.setSelectedIndex(mes);
        for (int i = 0; i < cbAno.getItemCount(); i++) {
            if (cbAno.getItemAt(i).equals(String.valueOf(ano))) {
                cbAno.setSelectedIndex(i);
            }
            
        }
        cbAno.setSelectedItem(ano);
    }

    private void limparCampos() {
        tfEscrituracao.setText(null);
        tfIntegracaoContabil.setText(null);
        tfDarfIrrf.setText(null);
        tfDaeParcelado.setText(null);
        tfISS.setText(null);
        tfIPI.setText(null);
        tjPIS.setText(null);
        tjICMSAntecipado.setText(null);
        tjICMSNormal.setText(null);
        tjCofins.setText(null);
        tjCSLL.setText(null);
        tjIRPJ.setText(null);
        tjSimplesNacional.setText(null);
        tfDataDaUltimaMovimentacao.setText(null);
        tfContribuicaoSindical.setText(null);
        tfIRRF.setText(null);
        tfFGTS.setText(null);
        tfIntegracaoContabil.setText(null);
        tfFolhaPagamento.setText(null);
        tfGPS.setText(null);
        tfRAIS.setText(null);
        tfRFB.setText(null);
        tfSEFAZ.setText(null);
        tfPrefeitura.setText(null);
        tfINSS.setText(null);
        tfCND_FGTS.setText(null);
        tfGIA_GIN.setText(null);
        tfDIRF.setText(null);
        tfDACON.setText(null);
        tfSEF.setText(null);
        tfDS.setText(null);
        tfSPED_FISCAL.setText(null);
        tfSPED_PIS.setText(null);
        tfDASN.setText(null);
        tfDCTF.setText(null);
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;


                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Metas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Metas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Metas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Metas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the dialog
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                Metas dialog = new Metas(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {

                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btCancelar;
    private javax.swing.JButton btSalvar;
    private javax.swing.JComboBox cbAno;
    private javax.swing.JComboBox cbMes;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JRadioButton rbComercial;
    private javax.swing.JRadioButton rbIndustrial;
    private javax.swing.JRadioButton rbLucroPresumido;
    private javax.swing.JRadioButton rbLucroReal;
    private javax.swing.JRadioButton rbServicos;
    private javax.swing.JRadioButton rbSimplesNacional;
    private javax.swing.JTextField tfCND_FGTS;
    private javax.swing.JTextField tfContabilizadoAte;
    private javax.swing.JTextField tfContribuicaoSindical;
    private javax.swing.JTextField tfDACON;
    private javax.swing.JTextField tfDASN;
    private javax.swing.JTextField tfDCTF;
    private javax.swing.JTextField tfDIPJ;
    private javax.swing.JTextField tfDIRF;
    private javax.swing.JTextField tfDS;
    private javax.swing.JTextField tfDaeParcelado;
    private javax.swing.JTextField tfDarfIrrf;
    private javax.swing.JTextField tfDataDaUltimaMovimentacao;
    private javax.swing.JTextField tfEscrituracao;
    private javax.swing.JTextField tfFGTS;
    private javax.swing.JTextField tfFolhaPagamento;
    private javax.swing.JTextField tfGIA_GIN;
    private javax.swing.JTextField tfGPS;
    private javax.swing.JTextField tfINSS;
    private javax.swing.JTextField tfIPI;
    private javax.swing.JTextField tfIRRF;
    private javax.swing.JTextField tfISS;
    private javax.swing.JTextField tfIntegracaoContabil;
    private javax.swing.JTextField tfIntegracaoContabilTrabalhista;
    private javax.swing.JTextField tfPrefeitura;
    private javax.swing.JTextField tfRAIS;
    private javax.swing.JTextField tfRFB;
    private javax.swing.JTextField tfSEF;
    private javax.swing.JTextField tfSEFAZ;
    private javax.swing.JTextField tfSPED_FISCAL;
    private javax.swing.JTextField tfSPED_PIS;
    private javax.swing.JTextField tjCSLL;
    private javax.swing.JTextField tjCofins;
    private javax.swing.JTextField tjICMSAntecipado;
    private javax.swing.JTextField tjICMSNormal;
    private javax.swing.JTextField tjIRPJ;
    private javax.swing.JTextField tjPIS;
    private javax.swing.JTextField tjSimplesNacional;
    // End of variables declaration//GEN-END:variables
}
